<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="js/jquery-3.5.1.js"></script>
<script>
    function add() {
        var name = document.getElementById("name");
        var score = document.getElementById("score")
        $.ajax({
            url: "http://localhost:8080/user/add/"+name.value+"/"+score.value,
            async: true
        });
        alert("添加User成功");
    }

</script>
<body>
<form name="tests">
    <table>
        <tr>
            <td>姓名：</td>
            <td><input type="text" id="name"/></td>
        </tr>
        <tr>
            <td>分数：</td>
            <td><input type="text" id="score"/></td>
        </tr>
        <!-- 表格中的内容如何封装成一个User对象，如果用thymeleaf，怎么提交和传递数据-->
        <tr>
            <td><input type="button" onclick="add()" value="提交"></td>
        </tr>
    </table>
</form>

</body>
</html>